[% page.title = 'API Method: match matrix show' 
   page.tab = 'api'
%]

<h2>GET /:user_id/matches/:folder_id/matrix/:type</h2>

<p>Returns a csv representation of the cosine similarity matrix with a 200 OK HTTP status code.
Content disposition is set as <em>attachment</em> 
so that these urls will prompt a web browser to save to a file rather than display the retrieved content.</p>

<h3>URL:</h3>
<code>[% site.url %]/<em>user_id</em>/matches/<em>folder_id</em>/matrix/<em>type</em>.<em>format</em></code>

<h3>Formats (<a href="formats">about return formats</a>):</h3>
<!--<code>[% INCLUDE 'api/_formats.phtml' %]</code>-->
All formats return plain csv text. i.e. the <code>format</code> is ignored (although this may change in the future).

<h3>HTTP Methods (<a href="http-methods">about HTTP methods</a>):</h3>
<code>GET</code>

<h3>Requires Authentication (<a href="authentication">about authentication</a>):</h3>
<code>true</code> &nbsp;if folder's <code>mode</code> property is set to <code>private</code><br/>
<code>false</code> &nbsp;if folder's <code>mode</code> property is set to <code>public</code>

<h3>Parameters:</h3>
<ul>
<li><code>folder_id</code>.  Required. The ID of the matches folder to retrieve from.</li>
<li><code><em>type</em></code>.  Optional. Determines which part or parts of the matrix are to be represented.
Values of <code>sort</code> must be one of:
<ul>
<li><code>all</code>, the full matrix with row and column labels.</li>
<li><code>rows</code>, the matrix row labels (i.e. names of items in profiles folder 1).</li>
<li><code>columns</code>, the matrix column labels (i.e. names of items in profiles folder 2).</li>
<li><code>values</code>, the matrix values without row and column labels.</li>
</ul>
The default when no value is supplied is <code>all</code>.
</li>
<li><code><em>separator</em></code>.  Optional. Specifies the csv separator character.
Values of <code>separator</code> must be one of:
<ul>
<li><code>comma</code>, separates values with a "," character.</li>
<li><code>colon</code>, separates values with a ":" character.</li>
<li><code>line</code>, separates values with "\n" so that each value appears on a new line.</li>
<li><code>space</code>, separates values with a " " character.</li>
<li><code>tab</code>, separates values with a "\t" character.</li>
</ul>
The default when no value is supplied is <code>comma</code>.
</li>
</ul>

<h3>Usage Examples:</h3>
<blockquote>
<h4>cURL (<a href="curl">about cURL</a>):</h4>
<code>curl -d "full=1" [% site.url %]/kdd09/matches/pc/matrix/values</code><br/>
</blockquote>

<h3>Response (<a href="return-values">about return values</a>):</h3>
<blockquote>
<h4>Example:</h4>
<pre>[% FILTER html -%]
0.0109207248595044,0.0109207248595044,0.00220278749843272,0
0.00344574134569426,0.00344574134569426,0.00238871094093343,0
0.00489485439947134,0.00489485439947134,0.00606903230886061,0
0.00950617534279174,0.00950617534279174,0.00464831429236867,0
0.0095239804154511,0.0095239804154511,0.00657917252631639,0
0.00134037499058935,0.00134037499058935,0.00142357136083981,0
0.0103706927017097,0.0103706927017097,0.000883302342004401,0
0.00364522105747995,0.00364522105747995,0.00160852920628979,0
0.0182432281653608,0.0182432281653608,0.00443688823025853,0
0.00410969035579841,0.00410969035579841,0.00576294453944129,0
0.00323173293494264,0.00323173293494264,0.00305585281726634,0.00160574171100059
0.0134592253093299,0.0134592253093299,0.0069069608899547,0
0.00750994803178469,0.00750994803178469,0.0029576255769522,0
.
.
.
0.00499720639474824,0.00499720639474824,0.00188036993093843,0
[% END %]</pre>
</blockquote>


